package com.zhouxiaoge.consumer.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;

@Slf4j
@RestController
public class IndexController {

    @Value("${server.port}")
    private String serverPort;

    @GetMapping
    public ResponseEntity<String> index() {
        return new ResponseEntity<>(LocalDateTime.now() + " --- " + serverPort, HttpStatus.OK);
    }
}
